import axios from 'axios'
import  * as type from './type'
const actions ={
    getNowHotMovies({ commit  }){
   axios({
       url:'/ajax/movieOnInfoList',
       methods:get ,
       params:{
           token:''  //后端做的，
       }
   })
   .then(res =>{
      console.log('movi-store-actions res',res)
      const action ={
          type:type.GET_NOW_HOT_MOVIES,
          payload:res  //将数据挂在这个上面
      }
      commit ( action ) //这步是将数据发送给mutations的
   })
   .catch( error =>{
       if( error ) throw error
   })
    }
}

export default actions